<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/tiles2/common.jsp" %>
<div class="page-header">
	<img class="fleft titlelogo" src="img/ext/glyphicons_138_picture.png">
	<h1>갤러리</h1>
</div>
<article>
	<div class="row">
		<div class="span5 offset1"><h3 class="dragup"><img src="img/ext/glyphicons_190_circle_plus.png" class="iconalign">새글쓰기</h3></div>
		<div class="span5 tright"><a class="btn btn-inverse" id="listgo"><i class="icon-list icon-white"></i>&nbsp;목록으로</a></div>
	</div>
	<div class="row">
		<div class="span10 offset1">
			<form class="well form-horizontal" id="galleryfrm">
				<fieldset>
					<div class="control-group error magleft">
						<label class="control-label" for="contents">제목</label>
						<div class="controls">
							<input type="text" id="title" name="title" class="span7">
						</div>
					</div>
					
					<div class="control-group error magleft ">
						<label class="control-label" for="contents">본문내용</label>
						<div class="controls">
							<textarea rows="20" class="span7" id="contents" name="contents"></textarea>
						</div>
					</div><!-- 본문내용 -->
					
					<div class="control-group info">
						<label class="control-label" for="img">이미지첨부</label>
						<div class="controls">
							<input type="file" id="img1" name="img"><br>
							<input type="file" id="img2" name="img"><br>
							<input type="file" id="img3" name="img"><br>
							<input type="file" id="img4" name="img"><br>
							<input type="file" id="img5" name="img"><br>
						</div>
					</div>
					
					
					
					<div class="control-group error magleft">
						<label class="control-label" for="captcha">자동가입방지</label>
						<div class="controls">
							<img src="img/captcha1.jpg" class="captcha"><br/>
							<input type="text" id="captcha" name="captcha"class="span3 dragdown">
							<a class="btn btn-inverse dragdown"><i class="icon-question-sign icon-white"></i>&nbsp;다음 captcha보기</a>
						</div>
					</div>
				</fieldset>
				<hr class="hdivider">
				<div class="tcenter">
				<a class="btn btn-success" id="savebtn">입력완료</a>
				<a class="btn btn-danger" id="notsave">취소하기</a>
				</div>
			</form>
		</div>
	</div>
	
	
</article>
<script type="text/javascript">
	$("#savebtn").on("click",function(event){
		if($("#title").val() == "")alert("제목을 입력해 주세요");
		else if($("#contents").val() == "")alert("본문 내용을 입력해 주세요");
		else{$("#galleryfrm").attr("method","post").submit();}
	});
	
	$("#notsave").on("click",function(event){
		if(confirm("취소하시겠습니까?"))
			$(location).attr("href","<c:url value='/gallery/list.tiles'/>");
	});
	
	$("#listgo").on("click",function(event){
			$(location).attr("href","<c:url value='/gallery/list.tiles'/>");
	});/* 목록으로 */
</script>


















